<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>Listado de Permiso</title>
    </head>
    <body>
        <f:view>
            <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            <h1>Listado de Permiso</h1>
            <h:form>
                <h:outputText escape="false" value="(sin registros)<br />" rendered="#{permiso.itemCount == 0}" />
                <h:panelGroup rendered="#{permiso.itemCount > 0}">
                    <h:outputText value="Item #{permiso.firstItem + 1}..#{permiso.lastItem} de #{permiso.itemCount}"/>&nbsp;
                    <h:commandLink action="#{permiso.prev}" value="Anterior #{permiso.batchSize}" rendered="#{permiso.firstItem >= permiso.batchSize}"/>&nbsp;
                    <h:commandLink action="#{permiso.next}" value="Siguiente #{permiso.batchSize}" rendered="#{permiso.lastItem + permiso.batchSize <= permiso.itemCount}"/>&nbsp;
                    <h:commandLink action="#{permiso.next}" value="Restante #{permiso.itemCount - permiso.lastItem}"
                                   rendered="#{permiso.lastItem < permiso.itemCount && permiso.lastItem + permiso.batchSize > permiso.itemCount}"/>
                    <h:dataTable value='#{permiso.permisos}' var='item' border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_oddrow,jsfcrud_evenrow" rules="all" style="border:solid 1px">
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Id Permiso"/>
                            </f:facet>
                            <h:outputText value=" #{item.idPermiso}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Descripcion Permiso"/>
                            </f:facet>
                            <h:outputText value=" #{item.descripcionPermiso}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText escape="false" value="&nbsp;"/>
                            </f:facet>
                            <h:commandLink value="[Ver]" action="#{permiso.detailSetup}">
                                <f:param name="jsfcrud.currentPermiso" value="#{permiso.asString[item]}"/>
                            </h:commandLink>
                            <h:outputText value=" "/>
                            <h:commandLink value="[Editar]" action="#{permiso.editSetup}">
                                <f:param name="jsfcrud.currentPermiso" value="#{permiso.asString[item]}"/>
                            </h:commandLink>
                            <h:outputText value=" "/>
                            <h:commandLink value="[Borrar]" action="#{permiso.destroy}">
                                <f:param name="jsfcrud.currentPermiso" value="#{permiso.asString[item]}"/>
                            </h:commandLink>
                        </h:column>
                    </h:dataTable>
                </h:panelGroup>
                <br />
                <h:commandLink value="[Nuevo]" action="#{permiso.createSetup}"> </h:commandLink>
                <br>
                
                <br />
                <a href="/sistemaReserva/faces/welcomeJSF.jsp" >[Indice]
                </a>
                
            </h:form>
        </f:view>
    </body>
</html>
